Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make On*Removed conventions run even if the declaring type was removed previously #29042

Merged
merged 1 commit into from
Sep 10, 2022

Conversation

AndriySvyryd
Copy link
Member

Fixes #19311
Fixes #20220

@AndriySvyryd AndriySvyryd requested a review from a team September 10, 2022 03:22

/// <inheritdoc />
public virtual void ProcessKeyRemoved(
IConventionEntityTypeBuilder entityTypeBuilder,
IConventionKey key,
IConventionContext<IConventionKey> context)
{
if (!entityTypeBuilder.Metadata.IsInModel)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is there a general rule for when IsInModel should be used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always, in the OnRemoved conventions. And elsewhere if you are paranoid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, one won't need to do these checks once we have layering

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course.

@ajcvickers ajcvickers merged commit 0827739 into release/7.0 Sep 10, 2022
@ajcvickers ajcvickers deleted the Issue20220 branch September 10, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants